package br.com.news.database.entities;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import br.com.news.database.utils.BaseEntity;

@Entity
@Table(name = "RespostaEnquete")
public class RespostaEnqueteEntity extends BaseEntity {

	private static final long serialVersionUID = -1769336951999198832L;

	@Id
	@GeneratedValue
	private Long idRespostaEnquete;

	@ManyToOne
	@JoinColumns({
		@JoinColumn(name="alternativa", referencedColumnName="alternativa"),
		@JoinColumn(name="idEnquete", referencedColumnName="idEnquete")
		})
	private AlternativaEnqueteEntity alternativaEnquete;

	private Date dataResposta;
	
	@Transient
	private long rowCount;
	
	public RespostaEnqueteEntity() {
	}

	public Long getIdRespostaEnquete() {
		return this.idRespostaEnquete;
	}

	public void setIdRespostaEnquete(Long idRespostaEnquete) {
		this.idRespostaEnquete = idRespostaEnquete;
	}

	public Date getDataResposta() {
		return this.dataResposta;
	}

	public void setDataResposta(Date dataResposta) {
		this.dataResposta = dataResposta;
	}

	public AlternativaEnqueteEntity getAlternativaEnquete() {
		return alternativaEnquete;
	}

	public void setAlternativaEnquete(AlternativaEnqueteEntity alternativaEnquete) {
		this.alternativaEnquete = alternativaEnquete;
	}

	public long getRowCount() {
		return rowCount;
	}

	public void setRowCount(long rowCount) {
		this.rowCount = rowCount;
	}
	
}

